//
// Decompiled by Jadx - 492ms
//
package me.plusne.Adapter.Login;

import a.i;
import android.os.Bundle;
import android.os.Message;
import android.text.TextUtils;
import androidx.activity.b;
import com.google.gson.Gson;
import de.robv.android.xposed.XposedHelpers;
import fi.c;
import fi.e;
import fi.w;
import fi.y;
import fm.m;
import fn.f;
import fn.j;
import fo.a;
import fp.s;
import fq.r;
import gc.ac;
import gc.af;
import gc.ag;
import gc.am;
import gc.ap;
import gc.at;
import gc.o;
import gc.u;
import gc.z;
import gj.k;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import me.plusne.GreenDao.dao.TopLabelDbDao;
import me.plusne.common.Json.JsonHookStatic;
import me.plusne.common.Json.Soul.JsonRecommend;
import me.plusne.common.Json.Soul.JsonSoulAutoMessage;
import me.plusne.common.Json.Soul.JsonSoulSeeList;
import me.plusne.common.Json.Soul.JsonSuccess;
import org.luckypray.dexkit.result.MethodData;
import r.g;

public final class h implements w.e, f.b, k.c, k.d, w.c, w.b, ag.b, w.f, ac.c, at.b {
    public final int a;

    public h(int i) {
        this.a = i;
    }

    public final void b(String str, Object[] objArr) {
        r.f i;
        String str2;
        switch (this.a) {
            case 14:
                HashMap hashMap = o.a;
                JsonRecommend jsonRecommend = (JsonRecommend) b.c(str, JsonRecommend.class);
                if (jsonRecommend != null && jsonRecommend.getData() != null && jsonRecommend.getData().getData() != null && jsonRecommend.getData().getData().size() > 0) {
                    for (JsonRecommend.DataBeanX.DataBean dataBean : jsonRecommend.getData().getData()) {
                        o.c++;
                        HashMap hashMap2 = new HashMap();
                        String f = g.f(dataBean.getCommodityUrl(), "heads/", ".");
                        hashMap2.put("avatarParams", "");
                        hashMap2.put("avatarName", f);
                        hashMap2.put("oriAvatarName", f);
                        ag agVar = new ag();
                        agVar.ct("https://api-user.soulapp.cn/v3/update/user/info", hashMap2, "PUT");
                        h hVar = new h(17);
                        Object[] objArr2 = {f, Integer.valueOf(o.c)};
                        if (agVar.cr != null) {
                            new Thread((Runnable) new af(agVar, hVar, objArr2, 0)).start();
                        } else {
                            j.bi(new Object[]{"Call 为空6"});
                        }
                    }
                    return;
                }
                r.f i2 = r.f.i();
                i2.j();
                i2.d = 48;
                i2.l("无数据");
                return;
            case 15:
                HashMap hashMap3 = o.a;
                JsonSuccess m = g.m(str);
                if (m == null) {
                    i = r.f.i();
                    i.j();
                    str2 = "-> 数据解析失败";
                } else if (m.isSuccess()) {
                    i = r.f.i();
                    i.n();
                    str2 = " -> 成功";
                } else {
                    r.f i3 = r.f.i();
                    i3.j();
                    i3.l("擦灰 -> " + m.getMessage());
                    return;
                }
                i.l(str2);
                return;
            case 16:
                HashMap hashMap4 = o.a;
                r.f i4 = r.f.i();
                i4.k();
                i4.l(str);
                return;
            case 17:
                HashMap hashMap5 = o.a;
                j.bi(new Object[]{objArr[0] + "|{ " + objArr[1] + " }|" + str});
                return;
            case 18:
                r.f i5 = r.f.i();
                i5.n();
                i5.l(str);
                return;
            case 19:
                r.f i6 = r.f.i();
                i6.k();
                i6.l(str);
                return;
            case 20:
            case 21:
            case 22:
            default:
                if (str.contains("\"message\":\"success\"")) {
                    r.f i7 = r.f.i();
                    i7.n();
                    i7.l("声音名片上传成功");
                    return;
                }
                b.u(str);
                return;
            case 23:
                ArrayList arrayList = ap.cp;
                j.bi(new Object[]{str});
                y.d();
                JsonSoulSeeList jsonSoulSeeList = (JsonSoulSeeList) new Gson().fromJson(str, JsonSoulSeeList.class);
                if (jsonSoulSeeList.getCode() == 10001 && jsonSoulSeeList.getData() != null && jsonSoulSeeList.getData().getList() != null) {
                    ArrayList arrayList2 = new ArrayList();
                    Iterator it = jsonSoulSeeList.getData().getList().iterator();
                    while (it.hasNext()) {
                        arrayList2.add(z.dm(((JsonSoulSeeList.DataDTO.ListDTO) it.next()).getUserIdEcpt()));
                    }
                    ac.dc("cn.soulapp.android.component.home.api.user.user.IUserApi", "USER", "getUserList", new fi.k(6, jsonSoulSeeList), new Object[]{(String[]) arrayList2.toArray(new String[0])});
                    return;
                }
                return;
        }
    }

    public final void c() {
        String str;
        boolean z;
        switch (this.a) {
            case 1:
                boolean z2 = a.a;
                r.f.i().l(" " + r.h.f(fn.y.cd(0, "Persistence")) + " 后自动关闭App");
                fn.y.by.setNewTime(System.currentTimeMillis() / 1000);
                a.a = false;
                return;
            case 2:
                fp.j.dv();
                return;
            case 3:
                fp.j.du(fp.j.cs);
                return;
            case 4:
                boolean z3 = s.cp;
                if (j.ae("TopLabel")) {
                    s.cq();
                    return;
                } else {
                    b.u("需要打开\"拦截顶部标签\"设置");
                    return;
                }
            case 5:
            case 9:
            default:
                int i = fy.g.cp;
                JsonHookStatic jsonHookStatic = fn.y.by;
                HashMap topLabelPPX = jsonHookStatic.getTopLabelPPX();
                w wVar = new w(jsonHookStatic.getActivity());
                wVar.bi("设置要隐藏的顶部导航(修改后需要重启)");
                wVar.bc("选择你要\"隐藏\"的导航(长按设置默认显示导航)");
                wVar.bj(fi.e.LIST_ITEM);
                String cf = fn.y.cf("defaultTop", "");
                c cVar = new c();
                cVar.setList(new ArrayList());
                cVar.setTitle("");
                cVar.setGroup(false);
                cVar.setGravity(8388611);
                if (topLabelPPX != null && topLabelPPX.size() > 0) {
                    for (Map.Entry entry : topLabelPPX.entrySet()) {
                        TopLabelDbDao topLabelDbDao = jsonHookStatic.getDb().z;
                        topLabelDbDao.getClass();
                        a.g gVar = new a.g(topLabelDbDao);
                        gVar.l(TopLabelDbDao.Properties.Title.f(entry.getKey()), new i[0]);
                        gVar.i(1);
                        m mVar = (m) gVar.k();
                        String str2 = (String) entry.getKey();
                        if (cf == null || !cf.equals(entry.getValue())) {
                            str = "";
                        } else {
                            str = "<font color='#0088FF'>默认导航</font>";
                        }
                        String str3 = (String) entry.getValue();
                        if (mVar != null) {
                            z = true;
                        } else {
                            z = false;
                        }
                        c.a aVar = new c.a();
                        aVar.setTitle(str2);
                        aVar.setDesc(str);
                        aVar.setKey(str3);
                        aVar.setSelected(z);
                        aVar.setSwitch(true);
                        cVar.getList().add(aVar);
                    }
                    wVar.aq.add(cVar);
                    fg.b bVar = wVar.y;
                    if (bVar != null) {
                        bVar.notifyItemChanged(r0.size() - 1);
                    }
                    wVar.af = new fy.f(topLabelPPX);
                    wVar.ae = new h(12);
                    wVar.bk();
                    return;
                }
                b.u("未获取到顶部导航列表");
                return;
            case 6:
                fq.h.dv();
                return;
            case 7:
                fq.h.du(fq.h.cs);
                return;
            case 8:
                boolean z4 = fq.k.cp;
                if (j.ae("TopLabel")) {
                    fq.k.cq();
                    return;
                } else {
                    b.u("需要打开\"拦截顶部标签\"设置");
                    return;
                }
            case 10:
                int i2 = r.a.a;
                r.f.i().l(" " + r.h.f(fn.y.cd(0, "Persistence")) + " 后自动关闭App");
                fn.y.by.setNewTime(System.currentTimeMillis() / 1000);
                r.cs = false;
                return;
        }
    }

    public final void d(Object obj, boolean z) {
        switch (this.a) {
            case 26:
                JsonSoulAutoMessage jsonSoulAutoMessage = at.cp;
                if (z) {
                    JsonSoulAutoMessage jsonSoulAutoMessage2 = new JsonSoulAutoMessage();
                    at.cp = jsonSoulAutoMessage2;
                    jsonSoulAutoMessage2.setPostId(XposedHelpers.getLongField(obj, "id"));
                    at.cp.setAuthorIdEcpt(j.as(obj, "authorIdEcpt"));
                    at.cp.setType(1);
                    at.cp.setSignature(j.as(obj, "signature"));
                    at.cs(1, XposedHelpers.getLongField(obj, "id"));
                    Message message = new Message();
                    Bundle bundle = new Bundle();
                    bundle.putSerializable("key", at.cp);
                    message.setData(bundle);
                    fn.y.by.getHandler().sendMessage(message);
                    return;
                }
                return;
            case 27:
                JsonSoulAutoMessage jsonSoulAutoMessage3 = at.cp;
                if (z) {
                    JsonSoulAutoMessage jsonSoulAutoMessage4 = new JsonSoulAutoMessage();
                    at.cp = jsonSoulAutoMessage4;
                    jsonSoulAutoMessage4.setPostId(XposedHelpers.getLongField(obj, "id"));
                    at.cp.setAuthorIdEcpt(j.as(obj, "authorIdEcpt"));
                    at.cp.setType(2);
                    at.cp.setSignature(j.as(obj, "signature"));
                    at.cs(2, XposedHelpers.getLongField(obj, "id"));
                    Message message2 = new Message();
                    Bundle bundle2 = new Bundle();
                    bundle2.putSerializable("key", at.cp);
                    message2.setData(bundle2);
                    fn.y.by.getHandler().sendMessage(message2);
                    return;
                }
                return;
            case 28:
                JsonSoulAutoMessage jsonSoulAutoMessage5 = at.cp;
                if (z) {
                    JsonSoulAutoMessage jsonSoulAutoMessage6 = new JsonSoulAutoMessage();
                    at.cp = jsonSoulAutoMessage6;
                    jsonSoulAutoMessage6.setPostId(XposedHelpers.getLongField(obj, "id"));
                    at.cp.setAuthorIdEcpt(j.as(obj, "authorIdEcpt"));
                    at.cp.setType(3);
                    at.cp.setSignature(j.as(obj, "signature"));
                    at.cs(3, XposedHelpers.getLongField(obj, "id"));
                    List cg = fn.y.cg("autoReplyText");
                    if (cg != null && !cg.isEmpty()) {
                        String key = ((fi.a) cg.get(g.c(0, cg.size() - 1))).getKey();
                        if (!TextUtils.isEmpty(key)) {
                            at.cp.setText(key);
                            Message message3 = new Message();
                            Bundle bundle3 = new Bundle();
                            bundle3.putSerializable("key", at.cp);
                            message3.setData(bundle3);
                            fn.y.by.getHandler().sendMessage(message3);
                            return;
                        }
                        return;
                    }
                    return;
                }
                return;
            default:
                JsonSoulAutoMessage jsonSoulAutoMessage7 = at.cp;
                if (z) {
                    JsonSoulAutoMessage jsonSoulAutoMessage8 = new JsonSoulAutoMessage();
                    at.cp = jsonSoulAutoMessage8;
                    jsonSoulAutoMessage8.setPostId(XposedHelpers.getLongField(obj, "id"));
                    at.cp.setAuthorIdEcpt(j.as(obj, "authorIdEcpt"));
                    at.cp.setType(4);
                    at.cp.setSignature(j.as(obj, "signature"));
                    at.cs(4, XposedHelpers.getLongField(obj, "id"));
                    Message message4 = new Message();
                    Bundle bundle4 = new Bundle();
                    bundle4.putSerializable("key", at.cp);
                    message4.setData(bundle4);
                    fn.y.by.getHandler().sendMessage(message4);
                    return;
                }
                return;
        }
    }

    public final void f(File file) {
        ArrayList arrayList = ap.cp;
        fn.y.co(file.getPath(), "VoicePath");
        r.f i = r.f.i();
        i.k();
        i.l("正在准备上传声音名片...");
        String path = file.getPath();
        am amVar = new am(file);
        MethodData methodData = z.cp;
        ac.dc("cn.soulapp.android.lib.common.upload.IUploadApi", "APIA", "getNewUploadTokenNoSource", new u(amVar, path, 1), new Object[]{path, "AUDIO"});
    }

    public final void g(w wVar, boolean z) {
        ArrayList arrayList;
        r.f i;
        String str;
        switch (this.a) {
            case 0:
                if (z) {
                    g.e(fn.y.by.getActivity(), false);
                    return;
                }
                return;
            case 20:
                MethodData methodData = z.cp;
                if (z) {
                    fn.y.co("no", "ChatBubble");
                    i = r.f.i();
                    i.n();
                    str = "默认气泡";
                } else {
                    fn.y.co("random", "ChatBubble");
                    i = r.f.i();
                    i.n();
                    str = "随机气泡";
                }
                i.l(str);
                return;
            case 21:
                ArrayList arrayList2 = ap.cp;
                if (z) {
                    g.d(fn.y.by.getActivity());
                    return;
                }
                return;
            default:
                ArrayList arrayList3 = ap.cp;
                if (z) {
                    wVar.c.dismiss();
                    fg.b bVar = wVar.y;
                    if (bVar != null) {
                        arrayList = bVar.b;
                    } else {
                        arrayList = null;
                    }
                    if (arrayList == null) {
                        b.u("没有可修改的瞬间");
                        return;
                    }
                    w wVar2 = new w(fn.y.by.getActivity());
                    wVar2.bj(fi.e.LIST_ITEM);
                    fi.b bVar2 = new fi.b();
                    bVar2.b("广场可见");
                    bVar2.b("仅主页可见");
                    bVar2.b("仅陌生人可见");
                    bVar2.b("仅自己可见");
                    wVar2.ay(bVar2);
                    wVar2.ae = new fg.f(4, new AtomicReference(""), arrayList);
                    wVar2.bk();
                    return;
                }
                wVar.c.dismiss();
                return;
        }
    }

    public final void h(String str, String str2, w wVar, boolean z) {
        HashMap hashMap = o.a;
        if (z && !TextUtils.isEmpty(str)) {
            fn.y.co(str, "isRegPhone");
            ag agVar = new ag();
            StringBuilder sb = new StringBuilder("https://api-account.soulapp.cn/v2/account/phoneRegistered?area=86&phone=");
            MethodData methodData = z.cp;
            sb.append((String) j.ad(j.ak(fn.y.cj("endata")), "encryption", new Object[]{str, j.ad(j.ak("cn.soulapp.android.soulpower.SoulPowerful"), "p", new Object[0])}));
            agVar.ct(sb.toString(), new HashMap(), "GET");
            agVar.cv(new gc.f(str, 0));
        }
    }

    public final void i(w wVar, c.a aVar, int i, int i2) {
        switch (this.a) {
            case 5:
                s.cp = true;
                JsonHookStatic jsonHookStatic = fn.y.by;
                TopLabelDbDao topLabelDbDao = jsonHookStatic.getDb().z;
                topLabelDbDao.getClass();
                a.g gVar = new a.g(topLabelDbDao);
                gVar.l(TopLabelDbDao.Properties.Top.f(aVar.getDesc()), new i[0]);
                gVar.i(1);
                m mVar = (m) gVar.k();
                if (aVar.isSelected()) {
                    if (mVar == null) {
                        m mVar2 = new m();
                        mVar2.b = aVar.getDesc();
                        mVar2.c = (String) jsonHookStatic.getTopLabelNames().get(aVar.getDesc());
                        jsonHookStatic.getDb().j(mVar2);
                        return;
                    }
                    return;
                }
                if (mVar != null) {
                    jsonHookStatic.getDb().h(mVar);
                    return;
                }
                return;
            case 9:
                fq.k.cp = true;
                JsonHookStatic jsonHookStatic2 = fn.y.by;
                TopLabelDbDao topLabelDbDao2 = jsonHookStatic2.getDb().z;
                topLabelDbDao2.getClass();
                a.g gVar2 = new a.g(topLabelDbDao2);
                gVar2.l(TopLabelDbDao.Properties.Top.f(aVar.getDesc()), new i[0]);
                gVar2.i(1);
                m mVar3 = (m) gVar2.k();
                if (aVar.isSelected()) {
                    if (mVar3 == null) {
                        m mVar4 = new m();
                        mVar4.b = aVar.getDesc();
                        mVar4.c = (String) jsonHookStatic2.getTopLabelNames().get(aVar.getDesc());
                        jsonHookStatic2.getDb().j(mVar4);
                        return;
                    }
                    return;
                }
                if (mVar3 != null) {
                    jsonHookStatic2.getDb().h(mVar3);
                    return;
                }
                return;
            default:
                int i3 = fy.g.cp;
                JsonHookStatic jsonHookStatic3 = fn.y.by;
                TopLabelDbDao topLabelDbDao3 = jsonHookStatic3.getDb().z;
                topLabelDbDao3.getClass();
                a.g gVar3 = new a.g(topLabelDbDao3);
                gVar3.l(TopLabelDbDao.Properties.Title.f(aVar.getTitle()), new i[0]);
                gVar3.i(1);
                m mVar5 = (m) gVar3.k();
                if (aVar.isSelected()) {
                    if (mVar5 == null) {
                        m mVar6 = new m();
                        mVar6.c = aVar.getTitle();
                        mVar6.b = aVar.getKey();
                        jsonHookStatic3.getDb().j(mVar6);
                        return;
                    }
                    return;
                }
                if (mVar5 != null) {
                    jsonHookStatic3.getDb().h(mVar5);
                    return;
                }
                return;
        }
    }
}
